import request from '@/utils/request'

// 查询评论列表
export function listQuestionComment(query) {
  return request({
    url: '/zs/QuestionComment/list',
    method: 'get',
    params: query
  })
}

// 查询问题的评论列表（按问题ID查询）
export function listQuestionCommentByQuestionId(zsQuestionId) {
  return request({
    url: '/zs/QuestionComment/listByQuestionId/' + zsQuestionId,
    method: 'get'
  })
}

// 查询评论详细
export function getQuestionComment(zsCommentId) {
  return request({
    url: '/zs/QuestionComment/' + zsCommentId,
    method: 'get'
  })
}

// 新增评论
export function addQuestionComment(data) {
  return request({
    url: '/zs/QuestionComment',
    method: 'post',
    data: data
  })
}

// 前台新增评论（无需权限）
export function addComment(data) {
  return request({
    url: '/zs/QuestionComment/addComment',
    method: 'post',
    data: data
  })
}

// 修改评论
export function updateQuestionComment(data) {
  return request({
    url: '/zs/QuestionComment',
    method: 'put',
    data: data
  })
}

// 删除评论
export function delQuestionComment(zsCommentId) {
  return request({
    url: '/zs/QuestionComment/' + zsCommentId,
    method: 'delete'
  })
}
